import { SelectControlSchema } from 'amis/lib/renderers/Form/Select'
import amisUtils from '@/components/amis/amisUtils'
import CaptchaApplicationStatusEnum from '@/core/captcha/enums/CaptchaApplicationStatusEnum'

class CaptchaApplicationStatusSelectUtils {
	getSchema = (parmas?: SelectControlSchema): SelectControlSchema => {
		const name = parmas?.name ? parmas.name : 'status'
		const mergeSchema = Object.assign(
			{
				name: name,
				type: 'select',
				label: '状态',
				clearable: true,
				options: amisUtils.getSelectOptionsFromBaseEnumValues(
					CaptchaApplicationStatusEnum.NORMAL,
					CaptchaApplicationStatusEnum.LOCKED,
				),
			},
			parmas,
		)

		const schema = mergeSchema
		return schema
	}
}

export default new CaptchaApplicationStatusSelectUtils()
